<%-- 
    Document   : index
    Created on : 7-giu-2009
    Author     : grillo
--%>

<%@ page import="mvc.framework.*" %>
<%@ page contentType="text/html" pageEncoding="UTF-8" %>

<%
    String pageToLoad = "";
   
    try {
        IRequestHandler requestHandler = SessionManager.getRequestHandler(session);
        
        pageToLoad = requestHandler.processRequest();  // Esecuzione della richiesta
    } catch (Exception exc) {
        pageToLoad = "errors/runtimeError.jsp";
        exc.printStackTrace();
    }
%>

<jsp:include page="pages/header.jsp" flush="false"></jsp:include>
<%
        if(SessionManager.getErrorMessage(session) != null) {
%>
            <jsp:include page="errors/errorPage.jsp" flush="false"></jsp:include>
<%
        }
%>

<jsp:include page="<%= pageToLoad %>" flush="false"></jsp:include>

<jsp:include page="pages/footer.jsp" flush="false"></jsp:include>